/**
 * @mbggenerated
 * @author wujian
 */
package bearworker.zxl.dao.mapper;

import bearworker.zxl.entity.DeliverySendPlace;
import org.apache.ibatis.jdbc.SQL;

public class DeliverySendPlaceSqlProvider {

    /* @mbggenerated */
    public String insertSelective(DeliverySendPlace record) {
        return new SQL() {
            {
                INSERT_INTO("delivery_send_place");

                if (record.getSendProvinceCode() != null) {
                    VALUES("send_province_code", "#{sendProvinceCode,jdbcType=VARCHAR}");
                }

                if (record.getSendProvinceName() != null) {
                    VALUES("send_province_name", "#{sendProvinceName,jdbcType=VARCHAR}");
                }

                if (record.getSendCityCode() != null) {
                    VALUES("send_city_code", "#{sendCityCode,jdbcType=VARCHAR}");
                }

                if (record.getSendCityName() != null) {
                    VALUES("send_city_name", "#{sendCityName,jdbcType=VARCHAR}");
                }

                if (record.getSendDistrictCode() != null) {
                    VALUES("send_district_code", "#{sendDistrictCode,jdbcType=VARCHAR}");
                }

                if (record.getSendDistrictName() != null) {
                    VALUES("send_district_name", "#{sendDistrictName,jdbcType=VARCHAR}");
                }

                if (record.getCreateTime() != null) {
                    VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}");
                }

                if (record.getCreateUser() != null) {
                    VALUES("create_user", "#{createUser,jdbcType=INTEGER}");
                }

                if (record.getUpdTime() != null) {
                    VALUES("upd_time", "#{updTime,jdbcType=TIMESTAMP}");
                }

                if (record.getUpdUser() != null) {
                    VALUES("upd_user", "#{updUser,jdbcType=INTEGER}");
                }

            }
        }.toString();
    }

    /* @mbggenerated */
    public String updateByPrimaryKeySelective(DeliverySendPlace record) {
        return new SQL() {
            {
                UPDATE("delivery_send_place");

                if (record.getSendProvinceCode() != null) {
                    SET("send_province_code = #{sendProvinceCode,jdbcType=VARCHAR}");
                }

                if (record.getSendProvinceName() != null) {
                    SET("send_province_name = #{sendProvinceName,jdbcType=VARCHAR}");
                }

                if (record.getSendCityCode() != null) {
                    SET("send_city_code = #{sendCityCode,jdbcType=VARCHAR}");
                }

                if (record.getSendCityName() != null) {
                    SET("send_city_name = #{sendCityName,jdbcType=VARCHAR}");
                }

                if (record.getSendDistrictCode() != null) {
                    SET("send_district_code = #{sendDistrictCode,jdbcType=VARCHAR}");
                }

                if (record.getSendDistrictName() != null) {
                    SET("send_district_name = #{sendDistrictName,jdbcType=VARCHAR}");
                }

                if (record.getCreateTime() != null) {
                    SET("create_time = #{createTime,jdbcType=TIMESTAMP}");
                }

                if (record.getCreateUser() != null) {
                    SET("create_user = #{createUser,jdbcType=INTEGER}");
                }

                if (record.getUpdTime() != null) {
                    SET("upd_time = #{updTime,jdbcType=TIMESTAMP}");
                }

                if (record.getUpdUser() != null) {
                    SET("upd_user = #{updUser,jdbcType=INTEGER}");
                }

                WHERE("id = #{id,jdbcType=INTEGER}");

            }
        }.toString();
    }
}